Change in openvpn[master]: dco: drop client prefix after DCO PEER_FLOAT notification
A message that is not in the archive (sent off-list or not yet received): gerrit.1753488078000.I1ad5df0f6785ffe9becd9f83329a9335d1a36f24@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
to review the following change.
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
dco: drop client prefix after DCO PEER_FLOAT notification
multi_process_float() will possibly float a client and also generate and set its new prefix.
However, after processing the PEER_FLOAT_NTF message, we were not clearing the prefix, thus effectivly making the generated prefix permanent until the next set_prefix() call.
Clear the prefix right after calling multi_process_float() to avoid printing messages with the wrong prefix.
Github: closes OpenVPN/openvpn#799
---
M src/openvpn/multi.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/16/1116/1
src/openvpn/multi.c +4 -0
@@ -3417,6 +3417,10 @@ &m->top.c2.from.dest, (struct sockaddr *)&dco->dco_float_peer_ss);multi_process_float (m, mi, mi->context.c2.link_sockets[0 ]); +/* multi_process_float() generated and set a new peer prefix, but we +* don't to keep it at this point. +*/ +clear_prefix (); CLEAR(dco->dco_float_peer_ss); }#endif /* if defined(TARGET_LINUX) || defined(TARGET_WIN32) */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: flichtenheld, ordex, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
Patchset:
PS2:
This does fix the problem observed. I'm not 100% sure it is the best place to reset the prefix (maybe we want to do it for incoming DCO messages instead?), but let's fix the obvious issue first.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Sun, 27 Jul 2025 10:24:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v2 1/1 dco: drop client prefix after DCO PEER_FLOAT notification
In reply to a message not in the archiveFrom: Antonio Quartulli <[email protected]...>
multi_process_float() will possibly float a client and also generate and set its new prefix.
However, after processing the PEER_FLOAT_NTF message, we were not clearing the prefix, thus effectivly making the generated prefix permanent until the next set_prefix() call.
Clear the prefix right after calling multi_process_float() to avoid printing messages with the wrong prefix.
Github: closes OpenVPN/openvpn#799
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1116
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/multi.c +4 -0
@@ -3417,6 +3417,10 @@ &m->top.c2.from.dest, (struct sockaddr *)&dco->dco_float_peer_ss);multi_process_float (m, mi, mi->context.c2.link_sockets[0 ]); +/* multi_process_float() generated and set a new peer prefix, but we +* don't to keep it at this point. +*/ +clear_prefix (); CLEAR(dco->dco_float_peer_ss); }#endif /* if defined(TARGET_LINUX) || defined(TARGET_WIN32) */
Attention is currently required from: flichtenheld, ordex, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
Patchset:
PS2:
Actually it is just fixing one particular symptom, but we can get there in other paths as well - here's a reconnect that happened to trigger the "query stats now!" timer
``` Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: checking for received messages Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: rtnl: received 36 bytes Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 net_route_v6_del: fd00:abcd:220:201::/64 via fd00:abcd:220:2::1006 dev tun1 table 0 metric 100 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: checking for received messages Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: rtnl: received 36 bytes Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 net_route_v6_del: fd00:abcd:220:200::74/128 via fd00:abcd:220:2::1006 dev tun1 table 0 metric 100 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: checking for received messages Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 sitnl_send: rtnl: received 36 bytes Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 dco_get_peer: peer-id -1 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 ovpn-dco: received netlink message type=31 cmd=3 flags=0x0002 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 ovpn_handle_peer: parsing message for peer 0... Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 ovpn_handle_peer: received data for a non-existing peer 0 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 ovpn-dco: received netlink message type=31 cmd=3 flags=0x0002 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 ovpn_handle_peer: parsing message for peer 1... Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 dco_update_peer_stat / dco_read_bytes(1): 1064936 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 dco_update_peer_stat / dco_write_bytes(1): 1064360 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 dco_update_peer_stat / tun_read_bytes(1): 1040000 Jul 27 12:14:55 ubuntu2004 tun-udp-p2mp[297683]: freebsd-74-amd64/udp6:194.97.140.3:62210 peer-id=2 dco_update_peer_stat / tun_write_bytes(1): 1040000 ```
no float involved, but still we have a "peer-id=2" prefix for "peer 1" counters.
So I would suggest to move the clear_prefix() call into the DCO functions that deal with incoming messages, most of which will not deal with "the client that is currently listed in the prefix". Maybe ovpn_handle_msg() (which would need the quivalent patch for FreeBSD and Windows)? Or something generic in dco.c that deals with DCO events?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Sun, 27 Jul 2025 10:39:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, ordex, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Here's another one... counter timer triggering while an outgoing TLS renegotiation is in progress
``` Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: udp6:[2001:608:0:814::fb00:14]:33827 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bits RSA, signature: RSA-SHA256, peer temporary key: 253 bits X25519, peer signing digest/type: SHA256 RSASSA-PSS Jul 27 12:33:36 ubuntu2004 kernel: [443346.370968] tun1: del peer 1 Jul 27 12:33:36 ubuntu2004 kernel: [443346.370974] tun1: deleting peer with id 1, reason 1 Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: udp6:[2001:608:0:814::fb00:14]:33827 [freebsd-14-amd64] Peer Connection Initiated with [AF_INET6]2001:608:0:814::fb00:14:33827 Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: freebsd-14-amd64/udp6:[2001:608:0:814::fb00:14]:33827 peer-id=2 dco_get_peer: peer-id -1 Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: freebsd-14-amd64/udp6:[2001:608:0:814::fb00:14]:33827 peer-id=2 ovpn-dco: received netlink message type=31 cmd=3 flags=0x0002 Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: freebsd-14-amd64/udp6:[2001:608:0:814::fb00:14]:33827 peer-id=2 ovpn_handle_peer: parsing message for peer 0... Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: freebsd-14-amd64/udp6:[2001:608:0:814::fb00:14]:33827 peer-id=2 dco_update_peer_stat / dco_read_bytes(0): 440 Jul 27 12:33:36 ubuntu2004 tun-udp-p2mp[298589]: freebsd-14-amd64/udp6:[2001:608:0:814::fb00:14]:33827 peer-id=2 dco_update_peer_stat / dco_write_bytes(0): 480 ```
in this case resetting the prefix would mess up prefix logging for the TLS handshake, so it's not the right approach anyway.
Digging through error.c I found something half-forgotten...
```
/* set up client prefix */
if (flags & M_NOIPREFIX)
{
prefix = NULL;
}
else
{
prefix = msg_get_prefix();
}
```so I think the *right* approach is to use msg(...|M_NOIPREFIX, ...) for everything that is not normally related to a particular MI instance - like, most of the DCO events.
Magic
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Sun, 27 Jul 2025 11:02:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Quoted 1 line
Actually it is just fixing one particular symptom, but we can get there in other paths as well - her […]
These are 2 different problems:
1) when we float we set an unexpected prefix and we stick to it.
2) when we parse notifications we may use the prefix coming from another instance.
This patch is trying to fix problem 1, which is similar but different from problem 2.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 28 Jul 2025 11:37:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Quoted 1 line
These are 2 different problems: […]
After fixing problem 1) we should heck what remains of problem 2, because we execute DCO commands always in the context of a known peer. We can't truly jump from peer X to peer Y. Also when doing a PEER_GET with id=-1 (dump all peers), we should not have any prefix set.
If we had one imho it was a leftover from the float (problem 1)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 28 Jul 2025 11:39:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Comment-In-Reply-To: ordex <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, ordex, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: drop client prefix after DCO PEER_FLOAT notification
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS2:
closing in on better understanding how the rest of multi.c does this
File src/openvpn/multi.c:
http://gerrit.openvpn.net/c/openvpn/+/1116/comment/e172fcee_459f337e :
PS2, Line 3421: * don't to keep it at this point.
don't "want" to keep it?
But I think we can just drop that comment, as the overall logic is always the same across multi.c
``` /* find mi that this is about */ set_prefix(mi); /* do something */ clear_prefix(); ```
... and I think this should look the same. Will test more and come back.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Mon, 08 Sep 2025 20:40:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
[Openvpn-devel] [XS] Change in openvpn[master]: dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archiveAttention is currently required from: cron2, flichtenheld, ordex, plaisthos.
cron2 has uploaded a new patch set (#3) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
The following approvals got outdated and were removed:
Code-Review-1 by cron2
Change subject: dco: add standard mi prefix handling to multi_process_incoming_dco()
......................................................................
dco: add standard mi prefix handling to multi_process_incoming_dco()
Our code generally expects functions that deal with a multi instance to set up a log prefix at the beginning with set_prefix(mi) and clear it at the end with clear_prefix().
Add the calls to multi_process_incoming_dco() in a similar way to what is done for multi_process_incoming_link() - handling "link events" and "dco events" the same, with correct prefix in the function and no leftover prefix afterwards.
Github: closes OpenVPN/openvpn#799
---
M src/openvpn/multi.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/16/1116/3
src/openvpn/multi.c +2 -0
@@ -3294,6 +3294,7 @@if ((peer_id < m->max_clients) && (m->instances[peer_id])) { mi = m->instances[peer_id]; +set_prefix (mi);if (dco->dco_message_type ==OVPN_CMD_DEL_PEER ) {process_incoming_del_peer (m, mi, dco);
@@ -3311,6 +3312,7 @@ {tls_session_soft_reset (mi->context.c2.tls_multi); } +clear_prefix (); }else {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-MessageType: newpatchset
[Openvpn-devel] [XS] Change in openvpn[master]: dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archiveAttention is currently required from: cron2, flichtenheld, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: add standard mi prefix handling to multi_process_incoming_dco()
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
This looks sane to me. The only question I have is: it possible that we had set another prefix before waiting for the next event and now this spurious DCO notification is getting in the way? Or we normally clear the prefix before going back to waiting for the next event?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 11 Sep 2025 19:00:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
[Openvpn-devel] [XS] Change in openvpn[master]: dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archiveAttention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: add standard mi prefix handling to multi_process_incoming_dco()
......................................................................
Patch Set 3: Code-Review+2
(1 comment)
Patchset:
PS3:
cooperative work
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 11 Sep 2025 20:12:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v3 1/1 dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archiveFrom: Antonio Quartulli <[email protected]...>
Our code generally expects functions that deal with a multi instance to set up a log prefix at the beginning with set_prefix(mi) and clear it at the end with clear_prefix().
Add the calls to multi_process_incoming_dco() in a similar way to what is done for multi_process_incoming_link() - handling "link events" and "dco events" the same, with correct prefix in the function and no leftover prefix afterwards.
Github: closes OpenVPN/openvpn#799
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1116
This mail reflects revision 3 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/multi.c +2 -0
@@ -3294,6 +3294,7 @@if ((peer_id < m->max_clients) && (m->instances[peer_id])) { mi = m->instances[peer_id]; +set_prefix (mi);if (dco->dco_message_type ==OVPN_CMD_DEL_PEER ) {process_incoming_del_peer (m, mi, dco);
@@ -3311,6 +3312,7 @@ {tls_session_soft_reset (mi->context.c2.tls_multi); } +clear_prefix (); }else {
[Openvpn-devel] [PATCH applied] Re: dco: add standard mi prefix handling to multi_process_incoming_dco()
This patch was basically a cooperation between Antonio and me, trying to figure out how things should be, and then fixing the omissions for the DCO event handler. This is what you get when you inherit an old code base full of magic... :-)
Tested on a FreeBSD+DCO system, with 3 clients renegotiating frequently, and one of them floating back and forth "right in the middle", and we think we now got both the mi prefix "for floating" and "afterwards" right.
An intermediate version had msg_get_prefix() / msg_set_prefix() calls to restore the previous prefix set afterwards, but it turns out that on intering the event handlers, it's "always NULL", because all other multi* functions correctly call prefix_reset() at end.
Your patch has been applied to the master and release/2.6 branch (bugfix).
commit 531fef40b73f73632548c88697af34cf15a70531 (master) commit 520a58d51fc53909d7e05ddf2a2da62eab439be3 (release/2.6)
Author: Antonio Quartulli Date: Thu Sep 11 22:12:16 2025 +0200
dco: add standard mi prefix handling to multi_process_incoming_dco()
Signed-off-by: Antonio Quartulli <[email protected]...>
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32859.html
URL: https://gerrit.openvpn.net/c/openvpn/+/1116
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [XS] Change in openvpn[master]: dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archivecron2 has uploaded a new patch set (#4) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: dco: add standard mi prefix handling to multi_process_incoming_dco()
......................................................................
dco: add standard mi prefix handling to multi_process_incoming_dco()
Our code generally expects functions that deal with a multi instance to set up a log prefix at the beginning with set_prefix(mi) and clear it at the end with clear_prefix().
Add the calls to multi_process_incoming_dco() in a similar way to what is done for multi_process_incoming_link() - handling "link events" and "dco events" the same, with correct prefix in the function and no leftover prefix afterwards.
Github: closes OpenVPN/openvpn#799
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32859.html
URL: https://gerrit.openvpn.net/c/openvpn/+/1116
---
M src/openvpn/multi.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/16/1116/4
src/openvpn/multi.c +2 -0
@@ -3294,6 +3294,7 @@if ((peer_id < m->max_clients) && (m->instances[peer_id])) { mi = m->instances[peer_id]; +set_prefix (mi);if (dco->dco_message_type ==OVPN_CMD_DEL_PEER ) {process_incoming_del_peer (m, mi, dco);
@@ -3311,6 +3312,7 @@ {tls_session_soft_reset (mi->context.c2.tls_multi); } +clear_prefix (); }else {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
[Openvpn-devel] [XS] Change in openvpn[master]: dco: add standard mi prefix handling to multi_process_incoming_dco()
In reply to a message not in the archivecron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email )
Change subject: dco: add standard mi prefix handling to multi_process_incoming_dco()
......................................................................
dco: add standard mi prefix handling to multi_process_incoming_dco()
Our code generally expects functions that deal with a multi instance to set up a log prefix at the beginning with set_prefix(mi) and clear it at the end with clear_prefix().
Add the calls to multi_process_incoming_dco() in a similar way to what is done for multi_process_incoming_link() - handling "link events" and "dco events" the same, with correct prefix in the function and no leftover prefix afterwards.
Github: closes OpenVPN/openvpn#799
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32859.html
URL: https://gerrit.openvpn.net/c/openvpn/+/1116
---
M src/openvpn/multi.c
1 file changed, 2 insertions(+), 0 deletions(-)
src/openvpn/multi.c +2 -0
@@ -3294,6 +3294,7 @@if ((peer_id < m->max_clients) && (m->instances[peer_id])) { mi = m->instances[peer_id]; +set_prefix (mi);if (dco->dco_message_type ==OVPN_CMD_DEL_PEER ) {process_incoming_del_peer (m, mi, dco);
@@ -3311,6 +3312,7 @@ {tls_session_soft_reset (mi->context.c2.tls_multi); } +clear_prefix (); }else {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1116?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ad5df0f6785ffe9becd9f83329a9335d1a36f24
Gerrit-Change-Number: 1116
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged